package com.example.qsaqmq.rabbitmq;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DirecRabbitConfig {

    public Queue TestRabbitQueue(){

        return new Queue("TestRabbitQueue",true);
    }

    @Bean
    DirectExchange TestRabbitDirectExchange(){
        return new DirectExchange("TestRabbitDirectExchange",true,false);
    }

    @Bean
    Binding bindingDirect(){
        return BindingBuilder.bind(TestRabbitQueue()).to(TestRabbitDirectExchange()).with("TestDirectRouting");
    }
}
